package com.taoz.rpc.core.fault.retry;

import com.taoz.rpc.core.config.ApplicationConfig;
import com.taoz.rpc.core.serializer.Serializer;
import com.taoz.rpc.core.spi.SpiLoader;

public class RetryHelperFactory {
    static {
        SpiLoader.load(RetryHelper.class);
    }

    public static RetryHelper getRetryHelper(String className) throws InstantiationException, IllegalAccessException {
        return (RetryHelper) SpiLoader.getInstance(className);
    }

    public static RetryHelper getRetryHelper() throws InstantiationException, IllegalAccessException {
        String className = ApplicationConfig.getConfig().getRetryHelper();
        return (RetryHelper) SpiLoader.getInstance(className);
    }
}
